<!DOCTYPE html>
<html lang="en">

<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta http-equiv="X-UA-Compatible" content="ie=edge">
 <title>Document</title>
 <!-- 引入layui.js -->
 <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
 <!-- 引入cropper.css -->
 <link rel="stylesheet" href="/assets/lib/cropper/cropper.css">
 <!-- 引入自己的css -->
 <link rel="stylesheet" href="/assets/css/user/user_avatar.css">
</head>

<body>

 <div class="layui-card">
  <div class="layui-card-header">卡片面板</div>
  <div class="layui-card-body">

   <!-- 第一行的图片裁剪和预览区域 -->
   <div class="row1">
    <!-- 图片裁剪区域 -->
    <div class="cropper-box">
     <!-- 这个 img 标签很重要，将来会把它初始化为裁剪区域 -->
     <img id="image" src="/assets/images/sample.jpg" />
    </div>
    <!-- 图片的预览区域 -->
    <div class="preview-box">
     <div>
      <!-- 宽高为 100px 的预览区域 -->
      <div class="img-preview w100"></div>
      <p class="size">100 x 100</p>
     </div>
     <div>
      <!-- 宽高为 50px 的预览区域 -->
      <div class="img-preview w50"></div>
      <p class="size">50 x 50</p>
     </div>
    </div>
   </div>

   <!-- 第二行的按钮区域 -->
   <div class="row2">
    <input id="changeImageInp" type="file" style="display:none">
    <button id="changeImageBtn" type="button" class="layui-btn">上传</button>
    <button type="button" id="uploadAvatar" class="layui-btn layui-btn-danger">确定</button>
   </div>


  </div>
 </div>
 <!-- 引入axios.js -->
 <script src="/assets/lib/axios.js"></script>
 <!-- 引入 common.js -->
 <script src="/assets/js/common.js"></script>
 <!-- 引入jquery.js -->
 <script src="/assets/lib/jquery.js"></script>
 <!-- 引入layui.all.js -->
 <script src="/assets/lib/layui/layui.all.js"></script>
 <!-- 引入cropper.js -->
 <script src="/assets/lib/cropper/Cropper.js"></script>
 <script src="/assets/lib/cropper/jquery-cropper.js"></script>
 <!-- 引入自己写的js -->
 <script src="/assets/js/user/user_avatar.js"></script>
</body>

</html>